main(i,w){char c[101],d[101];for(gets(c);~scanf("%s%s",c,d);puts(d[w]?"NO":"YES"))for(w=i=0;c[i];)c[i++]-d[w]?:w++;}
